package errmsg

const (
	SUCCESS = 200
	ERROR   = 500

	// code = 1000... 症状列表模块的错误
	ERROR_DESCRIPTION_NULL  = 1001
	ERROR_KEYWORD_NULL      = 1002
	ERROR_SYMPTHOMNAME_NULL = 1003
	ERROR_SYMPTHOMINFO_NULL = 1004
	// code = 2000... 用户模块的错误
	ERROR_USERNAME_USED    = 2001
	ERROR_PASSWORD_WRONG   = 2002
	ERROR_USER_NOT_EXIST   = 2003
	ERROR_TOKEN_EXIST      = 2004
	ERROR_TOKEN_RUNTIME    = 2005
	ERROR_TOKEN_WRONG      = 2006
	ERROR_TOKEN_TYPE_WRONG = 2007
	// code = 3000... 药品模块的错误
)

var codeMsg = map[int]string{
	SUCCESS:                 "OK",
	ERROR:                   "FAILD",
	ERROR_DESCRIPTION_NULL:  "症状描述为空",
	ERROR_KEYWORD_NULL:      "这个部位没有关键字",
	ERROR_SYMPTHOMNAME_NULL: "没有相关症状名称",
	ERROR_SYMPTHOMINFO_NULL: "没有相关症状信息",
	ERROR_USERNAME_USED:     "用户名已存在",
	ERROR_PASSWORD_WRONG:    "密码错误",
	ERROR_USER_NOT_EXIST:    "用户不存在",
	ERROR_TOKEN_EXIST:       "TOKEN不存在",
	ERROR_TOKEN_RUNTIME:     "TOKEN已过期",
	ERROR_TOKEN_WRONG:       "TOKEN不正确",
	ERROR_TOKEN_TYPE_WRONG:  "TOKEN格式错误",
}

func GetErrMsg(code int) string {
	return codeMsg[code]
}
